﻿@using WebVella.Erp.Web.Models;
@{
    var menu = (MenuItem)Model;

}

@if (menu.RenderWrapper)
{
	<div class="menu-nav-wrapper @menu.Class">
		<div class="menu-nav @(menu.Nodes.Count > 0 ? "dropdown" : "")">
			@if (menu.IsHtml)
			{
				@Html.Raw(menu.Content)
			}
			else
			{
				@menu.Content
			}
		</div>
		@if (menu.Nodes.Count > 0)
		{
			<div class="dropdown-menu level-0  @(menu.isDropdownRight ? "dropdown-menu-right" : "")">
				@foreach (var childMenu in menu.Nodes)
				{
					<partial name="NavItem" for="@childMenu"/>
				}
			</div>
		}
	</div>
}
else
{
	@if (menu.IsHtml)
	{
		@Html.Raw(menu.Content)
	}
	else
	{
		@menu.Content
	}
	@foreach (var childMenu in menu.Nodes)
	{
		<partial name="NavItem" for="@childMenu"/>
	}
}